package com.utf999.qiangmanger.entity.orm;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.utf999.qiangmanger.entity.UUIDEntity;

/**
 * 订单类型的配置定义，定义了一种服务单类型的积分奖惩信息
 * @author yinwenjie
 */
@Entity
@Table(name="O_OrderTypeDefine")
public class OrderTypeDefineEntity extends UUIDEntity {

	/**
	 * 
	 */
	private static final long serialVersionUID = 7308932580981410052L;
	
	/**
	 * 时间变化情况：单位为秒，注意只记录差量。<br>
	 * 负数表示订单耗费时间缩短；正数表示订单耗费时间增加。
	 */
	@Column(name="durationChange" , nullable=false)
	private Integer durationChange;
	
	/**
	 * 积分变化情况：单位为%(百分数)，注意只记录差量。<br>
	 * 负数表示积分减少；整数表示积分增加。一般来说durationChange和integralChange成反比
	 */
	@Column(name="integralChange" , nullable=false)
	private Integer integralChange;
	
	/**
	 * 这个定义所属的订单类型
	 */
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="orderType" , nullable=false)
	private OrderTypeEntity orderType;
	
	/**
	 * 定义的创建时间
	 */
	@Column(name="createTime" , nullable=false)
	private Date createTime;
	
	public Integer getDurationChange() {
		return durationChange;
	}

	public void setDurationChange(Integer durationChange) {
		this.durationChange = durationChange;
	}
	
	public Integer getIntegralChange() {
		return integralChange;
	}

	public void setIntegralChange(Integer integralChange) {
		this.integralChange = integralChange;
	}

	public OrderTypeEntity getOrderType() {
		return orderType;
	}

	public void setOrderType(OrderTypeEntity orderType) {
		this.orderType = orderType;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	/* (non-Javadoc)
	 * @see com.utf999.qiangmanger.entity.UUIDEntity#getUniqueKey()
	 */
	@Override
	public String getUniqueKey() {
		return "uid";
	}
}